QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing RAVE Features

The QuickDraw 3D Renderer Acceleration Virtual Engine (RAVE) is the part of the Mac OS that controls 3D drawing engines, also called 3D drivers. It is used internally by QuickDraw 3D. A drawing engine is software that supports the low-level rasterization operations required for interactive 3D rendering. To achieve interactive performance, a drawing engine is often associated with some hardware device designed specifically to accelerate 3D rasterization.

For most 3D drawing and interaction, you should use the high-level application programming interfaces described in this book. In some cases, however, you may need to use the low-level services provided by RAVE; for example,

This section describes four QuickDraw 3D routines that provide you with limited access to RAVE. Two of them get and set the RAVE texture filter; the other two get and set RAVE context hints.

The texture mapping filter mode of the drawing engine determines how the engine performs texture mapping. The default value for a drawing engine that supports texture mapping is kQATextureFilter_Fast . The texture mapping filter state variable is optional; it must be supported only when a drawing engine supports the kQAOptional_Texture feature.

You specify an engine's texture filter by assigning a value to its kQATag_TextureFilter state variable. The default value of this variable for a drawing engine that supports texture mapping is kQATextureFilter_Fast .

#define kQATextureFilter_Fast                       0
#define kQATextureFilter_Mid                        1
#define kQATextureFilter_Best                       2

Constant descriptions

kQATextureFilter_Fast
The drawing engine performs whatever level of texture filtering it can do with no speed penalty. This often means that no texture filtering is performed.
kQATextureFilter_Mid
The drawing engine performs a medium level of texture filtering. You should use this texture mapping filter mode when you want to perform texture mapping interactively.
kQATextureFilter_Best
The drawing engine performs the highest level of texture filtering it can. This mode may be unsuitable for interactive rendering.

Q3InteractiveRenderer_GetRAVETextureFilter

You can use the Q3InteractiveRenderer_GetRAVETextureFilter function to access the current RAVE kQATag_TextureFilter state variable described above.

TQ3Status Q3InteractiveRenderer_GetRAVETextureFilter (
                     TQ3RendererObject    renderer,
                     unsigned long         *RAVEtextureFilterValue);
renderer
A renderer object.
RAVEtextureFilterValue
The value of the renderer's kQATag_TextureFilter state variable.

DESCRIPTION

The Q3InteractiveRenderer_GetRAVETextureFilter function returns, in the RAVEtextureFilterValue parameter, the current value of the renderer's kQATag_TextureFilter state variable.

Q3InteractiveRenderer_SetRAVETextureFilter

You can use the Q3InteractiveRenderer_SetRAVETextureFilter function to set the current RAVE kQATag_TextureFilter state variable.

TQ3Status Q3InteractiveRenderer_SetRAVETextureFilter (
                     TQ3RendererObject    renderer,
                     unsigned long         RAVEtextureFilterValue);
renderer
A renderer object.
RAVEtextureFilterValue
The value of the renderer's kQATag_TextureFilter state variable.

DESCRIPTION

The Q3InteractiveRenderer_SetRAVETextureFilter function sets the value in the RAVEtextureFilterValue parameter to be the current value of the renderer's kQATag_TextureFilter state variable. For a list of possible values, see [link] .

Although a drawing engine may be capable of supporting more than one device, it cannot divide a raster across multiple devices. Instead, every drawing command sent to a drawing engine must be destined for a single device. QuickDraw 3D RAVE guarantees this by requiring a calling application to specify a draw context as a parameter for every drawing command. A draw context is a structure (of type TQADrawContext ) that maintains state information and other data associated with a particular drawing engine and device.

As mentioned at the end of the previous section, you need to create several draw contexts if you want to draw into a window that spans several devices. Similarly, you need to create several draw contexts if you want to draw into several different windows on the same device. Each draw context maintains its own state information image buffers and is unaffected by any functions that operate on another draw context.

The state information associated with a draw context is maintained using a large number of state variables. For example, the background color of a draw context is specified by four state variables, designated by the four identifiers (or tags ) kQATag_ColorBG_a , kQATag_ColorBG_r , kQATag_ColorBG_g , and kQATag_ColorBG_b .

Q3InteractiveRenderer_GetRAVEContextHints

You can use the Q3InteractiveRenderer_GetRAVEContextHints function to get the RAVE draw context hints for a specific renderer.

TQ3Status Q3InteractiveRenderer_GetRAVEContextHints (
                     TQ3RendererObject    renderer,
                     unsigned long        *RAVEContextHints);
renderer
A renderer.
RAVEContextHints
A set of RAVE draw context hints.

DESCRIPTION

The Q3InteractiveRenderer_GetRAVEContextHints function returns, in the RAVEContextHints parameter, the stored context hints for renderer.

Q3InteractiveRenderer_SetRAVEContextHints

You can use the Q3InteractiveRenderer_SetRAVEContextHints function to set the RAVE draw context hints for a specific renderer.

TQ3Status Q3InteractiveRenderer_SetRAVEContextHints (
                     TQ3RendererObject    renderer,
                     unsigned long        RAVEContextHints);
renderer
A renderer.
RAVEContextHints
A set of RAVE draw context hints.

DESCRIPTION

The Q3InteractiveRenderer_SetRAVEContextHints function sets the draw context hints for renderer to the value in the RAVEContextHints parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |